<div id="products"><!--start products-->
    <div class="box">
        <div class="box_left">
            <div class="box_right"><span>Tin Tức</span></div>
        </div>
    </div>
    <div class="article">
        <h1><?php echo $article->title ?></h1>
        <p class="summary"><?php echo $article->summary ?></p>
        <p class="date">Đăng ngày: <?php echo date('d-m-Y H:i:s', $article->created) ?></p>
        <?php echo $article->content ?>
    </div>
    
<?php
if(isset ($other_articles) == TRUE && count($other_articles) > 0) :
?>
    <div class="box">
        <div class="box_left">
            <div class="box_right"><a href="#" title="">Tin Khác</a></div>
        </div>
    </div>
    <div class="article">
        <ul class="others">
<?php
    foreach($other_articles as $obj) :
        preg_match('/<\s*img [^\>]*src\s*=\s*(["\'])(.*?)\1/', $obj->content, $matches);
        if (is_array($matches) && !empty($matches))
        {
           $image = $matches[2];
        }
        else
        {
           $image = Url::site('assets/image/no-image.jpg');
        }
?>
            <li>
                <p class="img">
                    <span>
                        <img src="<?php echo $image ?>" alt="" width="100" />
                    </span>
                </p>
                <p class="title">
                    <a href="<?php echo Url::site('article/detail/' . $obj->id) ?>"><?php echo $obj->title ?></a>
                    <span>(<?php echo date('d/m/Y', $obj->created) ?>)</span>
                    <br />
                    <?php echo $obj->summary ?>
                </p>
            </li>
<?php
    endforeach;
?>
        </ul>
    </div>
<?php
endif;
?>
</div><!--end products-->